package com.demo.crud.controller;

import com.demo.crud.dao.EmployeeDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created with IntelliJ IDEA.
 *
 * @author: keen
 * Date: 2019-06-07
 * Time: 17:35
 */
@Controller
@RequestMapping("/employee")
public class EmployeeController {
    @Autowired
    private EmployeeDao employeeDao;
    @GetMapping("/list")
    public String list(Model model) {
        model.addAttribute("employeeList", employeeDao.getAll());
        return "list";
    }


}
